getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Sun, 18 Oct 2020 16:03:46 +0000 (17:03 +0100)
committerRyan Tandy <ryan@nardis.ca>
Sun, 18 Oct 2020 16:03:46 +0000 (17:03 +0100)
commit0b8f49221e0c8b734b76ed680fde405847b5fc4d
treebab328dfcaf156de8845a0243087b516d8e668b9
parent97bfbf626a1b77735b10ac0d0c993a06082ae800
getaddrinfo-is-threadsafe

OpenLDAP upstream conservatively assumes that certain resolver functions
(getaddrinfo, getnameinfo, res_query, dn_expand) are not re-entrant; but we
know that the glibc implementations of these functions are thread-safe, so
we should bypass the use of this mutex.  This fixes a locking problem when
an application uses libldap and libnss-ldap is also used for hosts
resolution.

Closes Debian bug #340601.

Not suitable for forwarding upstream; might be made suitable by adding a
configure-time check for glibc and disabling the mutex only on known
thread-safe implementations.

Gbp-Pq: Name getaddrinfo-is-threadsafe
libraries/libldap/os-ip.c
libraries/libldap/util-int.c